#ifndef HASIO_DETAIL_SOCKET_TYPES_HPP
#define HASIO_DETAIL_SOCKET_TYPES_HPP

#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)

#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/ioctl.h>

namespace hasio {
namespace detail {

using socket_type = int;
using signed_size_type = ssize_t;
using socket_addr_type = sockaddr;
using socket_addr_in4_tpye = sockaddr_in;
using socket_addr_in6_tpye = sockaddr_in6;

using ulong_type = uint32_t;
using ushort_type = uint16_t;

using ioctl_arg_type = int;

constexpr int invalid_socket = -1;
constexpr int socket_error_retval = -1;

#define SOCKET_DEF(c) SOCKET_DEF_##c
#define SOCKET_DEF_AF_INET AF_INET
#define SOCKET_DEF_AF_INET6 AF_INET6
#define SOCKET_DEF_IPPROTO_TCP IPPROTO_TCP
#define SOCKET_DEF_SOCK_STREAM SOCK_STREAM

#define SOCKET_DEF_INADDR_ANY INADDR_ANY

}
}

#endif // HASIO_DETAIL_SOCKET_TYPES_HPP